package com.xjoyt.pay.master.controllers;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.master.interfaces.DistributorRateContract;
import com.xjoyt.pay.master.services.DistributorRateService;
import com.xjoyt.pay.master.vo.DistributorRateMap;
import com.xjoyt.pay.master.vo.RateEntry;
import com.xjoyt.pay.merchant.register.params.DistributorPageParam;

@RestController
@RequestMapping("distributorRate")
public class DistributorRateController extends AbstractController implements DistributorRateContract {

	@Autowired
	private DistributorRateService service;

	@Override
	public PageResult<DistributorRateMap> loadPageRate(@RequestBody PageParam<DistributorPageParam> param) {
		return service.loadPage(param);
	}

	@Override
	public ExecuteResult<?> saveRate(@RequestBody DistributorRateMap param) {
		return service.saveRate(param);
	}

	@Override
	public List<RateEntry> findAllRateEntry(@RequestBody String id) {
		return service.findAllRateEntry(id);
	}

}
